<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>访客详情</title>
    <meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0.maximum-scale=1.0,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/homePage.css">
    <link rel="stylesheet" href="css/flexible.css">
    <link rel="stylesheet" href="css/vant.css">
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/flexible.js"></script>
    <script src="js/vue.js"></script>
    <script src="js/MD5.js"></script>
    <script src="js/axios.js"></script>
    <script src="js/vant.js"></script>
</head>
<body>
<div id="app">
    <template>
        <div class="container_box" >
            <div class="group_details head_card_message clearfix" style="padding-right: 0.1rem;">
                    <div class="fl head_card">
                        <img :src="Picurl"  class="spinning_img">
                    </div>
                    <div class="spinning_txt fl">
                        <div class="fk_star">
                            <div class="lf">{{Username}}</div>
                            <div class="starts lf">
                                <ul id="pingStar">
                                    <li rel="1" title="1分" v-for="(item,index) in items" :class="{on:Level>=index}">★</li>
                                </ul>
                            </div>
                            <div class="fk_phone">
                                <a :href="'tel:'+Phone+''"><img src="images/phone.png"/></a>
                            </div>
                        </div>
                        <p class="fk_phone1">
                            <a :href="'tel:'+Phone+''">
                                <span class="spinning_name">{{Phone}}</span>
                            </a>
                        </p>
                    </div>
            </div>
            <div class="tar_qh fk_content">
                <div class="addFollow" @click="addFollow()">+添加跟进记录</div>
                <ul class="nav">
                    <li class="selected" style="width: 46%">跟进记录</li>
                    <li style="width: 46%">详细信息</li>
                </ul>
                <div class="content">
                    <div class="list">
                        <div v-if="list.length>0">
                            <div class="gj_Record" v-for="item in list">
                                <div class="lf progress_bar"></div>
                                <div class="gj_message">
                                    <div class="gj_title">
                                        <p class="lf card_title" v-if="item.Ftype==0">电话跟进</p>
                                        <p class="lf card_title" v-else-if="item.Ftype==1">微信跟进</p>
                                        <p class="lf card_title" v-else-if="item.Ftype==2">QQ跟进</p>
                                        <p class="lf card_title" v-else-if="item.Ftype==3">短信跟进</p>
                                        <p class="lf card_title" v-else>面谈跟进</p>
                                        <p class="rf">跟进人：<span>{{item.Sname}}</span></p>
                                    </div>
                                        <ul class="card_information">
                                        <li>
                                                {{item.Info}}
                                        </li>
                                        <li>
                                            <span>{{item.Addtime}}</span>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div v-else style="text-align: center;margin-top:.3rem;">
                                <img src="images/notDate.jpg">
                        </div>
                    </div>
                    <div  class="list" style="display: none">
                        <ul class="fk_list_two">
                            <li>
                                <span>添加人：</span>
                                <span>{{Sname}}</span>
                            </li>
                            <li>
                                <span>添加日期：</span>
                                <span>{{Addtime}}</span>
                            </li>
                            <li>
                                <span>最近跟进日期：</span>
                                <span>{{Newfollow}}</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </template>
    <div class="add_jl"><a href="index.html"><img src="images/back.png"></a></div>
</div>
</body>
<script>
$(function(){
    //获取点击事件的对象
    var divShow = $(".content").children('.list');
    $(divShow[1]).hide();
    $(".nav li").click(function(){
        //获取要显示或隐藏的对象
        var divShow = $(".content").children('.list');
        //判断当前对象是否被选中，如果没选中的话进入if循环
        if (!$(this).hasClass('selected')) {
            //获取当前对象的索引
            var index = $(this).index();
            //当前对象添加选中样式并且其同胞移除选中样式；
            $(this).addClass('selected').siblings('li').removeClass('selected');
            //索引对应的div块显示
            $(divShow[index]).show();
            //索引对应的div块的同胞隐藏
            $(divShow[index]).siblings('.list').hide();
        }
    });
});


new Vue({
    el: '#app',
    data: {
        uid:'',
        Username:'',
        Phone:'',
        Picurl:'',
        Level:'',
        Addtime:'',
        Sname:'',
        Newfollow:'',
        list:[],
        items:[
            {text:'1'},
            {text:'1'},
            {text:'1'},
            {text:'1'},
            {text:'1'}
        ]
    },
    created(){
        this.setCanS()
    },
    methods:{
         //设置参数
         setCanS(){
            let Request = new Object()
            Request = GetRequest()
            this.uid = Request['uid']
            this.getList()
        },
        //获取信息
        getList(){
            getVs()
            const params={
                uid:this.uid
            }
            axios.get('/mobileapi/adviser/customer.php?act=follow_list',{params:params}).then(data =>{
                console.log(data.data)
                let { msg, code,user} = data.data
                    if (code !== 200) {
                        window.vant.Toast.fail(msg)        
                    } else {
                        data=data.data
                        this.Phone=data.data.Phone
                        this.Username=data.data.Username
                        this.Level=data.data.Level-1
                        this.Newfollow=data.data.Newfollow 
                        this.Addtime=data.data.Addtime 
                        this.Sname=data.data.Sname 
                        if(this.Picurl==null||this.Picurl==''){
                            this.Picurl='images/moren.png'
                        }
                        this.list=data.data.list
                    }
                }).catch(function (error) { 
                    console.log(error); 
            });
        },
        addFollow(uid){
            window.location.href='customerFollow.html?uid='+this.uid+''
        },
        //返回首页
        back(){
            window.location.href='index.html'
        }
    }
})
</script>
</html>